package com.minivision.fdiot.service;

import java.util.List;
import java.util.Set;

import com.minivision.fdiot.entity.DeviceFaceSet;
import org.springframework.data.domain.Page;

import com.minivision.fdiot.entity.Device;
import com.minivision.fdiot.rest.param.device.CreateDeviceParam;
import com.minivision.fdiot.rest.param.device.QueryDeviceParam;
import com.minivision.fdiot.rest.param.device.UpdateDeviceParam;

public interface DeviceService {
  
  Device save(Device device);

  Device createDevice(CreateDeviceParam device);
  
  List<Device> createBatch(Iterable<Device> devices);
  
  Device updateDevice(UpdateDeviceParam device);
  
  void deleteDevice(Long deviceId);
  
  void deleteDeviceBySn(String deviceSn);
  
  long deleteBatch(List<Long> deviceIds);
  
  long deleteBatchBySn(Set<String> deviceSns);
  
  List<Device> findByAppKey(String appKey);
  
  List<Device> findByAppKeyAndFaceSetToken(String appKey, String facesetToken);
  
  List<Device> findByFaceSetToken(String facesetToken);
  
  //List<Device> findDevices(Device device);
  
  Page<Device> findByPage(QueryDeviceParam param);
  
  void activateDevice(String deviceSn);
  
  void deviceOnline(String sn, String connectNode);
  
  void deviceOffline(String sn, String connectNode);
  
  void deviceLost(String sn, String connectNode);
  
  Device findDevice(String sn);
  
  Device findById(Long id);
  
  List<Device> findDevices(List<String> deviceSns);
  
  String getActivationCode(String model, String sn);

  List<DeviceFaceSet> findFaceSetBySn(String sn);
  
}
